import csv

with open('scores.csv', 'r') as file:
    reader = csv.reader(file)
    next(reader)
    data = list(reader)

for row in data:
    print(row)

scores = []
for row in data:
    scores.append(int(row[2]))
print(scores)

def calc_mean(scores):
    return sum(scores) / len(scores)

def calc_median(scores):
    sorted_scores = sorted(scores)
    n = len(sorted_scores)
    if n % 2 == 1:
        return sorted_scores[n // 2]
    else:
        return (sorted_scores[n // 2 - 1] + sorted_scores[n // 2]) / 2

def calc_mode(scores):
    from collections import Counter
    counter = Counter(scores)
    most_common = counter.most_common(1)
    return most_common[0][0]

mean = calc_mean(scores)
median = calc_median(scores)
mode = calc_mode(scores)

print(f"the mean is {mean}")
print(f"the median is {median}")
print(f"the mode is {mode}")